﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UboxUI
{
    public partial class FrmUser_Son : FrmUser_Father
    {
        public FrmUser_Son()
        {
            InitializeComponent();
            this.penUser.BringToFront();
            this.ban01.BringToFront();
            this.banner.BringToFront();
            this.banner.Top = (this.ban01.Height);
            this.picLogo.Left = (this.banner.Width / 2) - (this.picLogo.Width / 2);
            this.picsearch.Left = this.ban01.Left;
            this.btncontrol.Left = (this.BtnClose.Left + this.BtnClose.Width) - (this.btncontrol.Width);
            this.penUser.Left = (this.btncontrol.Left + this.btncontrol.Width) - (this.penUser.Width);
            this.penUser.Top = (this.ban01.Height) + (this.banner.Height);
            this.ban02.Top = (this.ban01.Height) + (this.banner.Height)-(this.ban03.Height);
            this.penUser.Visible = false;
            this.ban03.Visible = false;
            this.panBrand.Visible = false;
            this.panBrand01.Visible = false;
            this.panBrand02.Visible = false;
        }

        bool C1 ;
        private void btncontrol_Click(object sender, EventArgs e)
        {
            if (C1 == false)
            {
                this.penUser.Visible = !this.penUser.Visible;
            }
            else 
            {
                C1 = false;
            }
        }
        bool C2;
        private void btnUpDown_Click(object sender, EventArgs e)
        {
            if (this.ban02.Top == (this.ban01.Height) + (this.banner.Height) - (this.ban03.Height))
            {
                if (C2 == false)
                {
                    this.ban02_Timer.Enabled = true;
                    C2 = true;
                }
            }
            if (this.ban02.Top >= (this.ban01.Height) + (this.banner.Height)) 
            { 
                this.ban02_TimerBack.Enabled = true;
                C2 = false;
            }
        }

        private void ban02_Timer_Tick(object sender, EventArgs e)
        {
            this.ban02.Top += 15;
            if (this.ban02.Top >= (this.ban01.Height) + (this.banner.Height)) 
            {
                this.ban03.Visible = !this.ban03.Visible;
                this.ban02_Timer.Enabled = false;
            }
        }

        private void ban02_TimerBack_Tick(object sender, EventArgs e)
        {
            this.ban02.Top -= 15;
            if (this.ban02.Top <= (this.ban01.Height) + (this.banner.Height) - (this.ban03.Height)) 
            {
                this.ban03.Visible = !this.ban03.Visible;
                this.ban02.Top = (this.ban01.Height) + (this.banner.Height) - (this.ban03.Height);
                this.panBrand.Visible = false;
                this.panBrand01.Visible = false;
                this.panBrand02.Visible = false;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.picPad.Width) + 3;
                C3 = false;
                C4 = false;
                C5 = false;
                this.ban02_TimerBack.Enabled = false;
            }
        }
        bool C3;
        private void picPhone_Click(object sender, EventArgs e)
        {
            if (C3 == false)
            {
                this.panBrand02.Visible = false;
                this.panBrand01.Visible = false;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.picPad.Width) + 3;

                this.panBrand.Visible = true;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.panBrand.Width);
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.panBrand.Width) + (this.picPad.Width) + 3;
                this.panBrand.Top = this.picPhone.Top;
                this.panBrand.Left = (this.picPhone.Left) + (this.picPhone.Width);
                C3 = !C3;
                C4 = false;
                C5 = false;
            }
            else 
            {
                this.panBrand.Visible = false;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) +  (this.picPad.Width) + 3;
                C3 = !C3;
            }
        }
        bool C4;
        private void picPad_Click(object sender, EventArgs e)
        {
            if (C4 == false)
            {
                this.panBrand.Visible = false;
                this.panBrand02.Visible = false;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.picPad.Width) + 3;

                this.panBrand01.Visible = true;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.panBrand01.Width) + (this.picPad.Width) + 3;
                this.panBrand01.Top = this.picPhone.Top;
                this.panBrand01.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3 + (this.picPad.Width);
                C4 = !C4;
                C3 = false;
                C5 = false;
                
               
            }
            else 
            {
                this.panBrand01.Visible = false;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.picPad.Width) + 3;
                C4 = !C4;
            }
        }
        bool C5;
        private void picWear_Click(object sender, EventArgs e)
        {
            if (C5 == false)
            {
                this.panBrand.Visible = false;
                this.panBrand01.Visible = false;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.picPad.Width) + 3;

                this.panBrand02.Visible = true;
                this.panBrand02.Top = this.picPhone.Top;
                this.panBrand02.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3 + (this.picPad.Width) + 3 + (this.picWear.Width);
                C5 = !C5;
                C3 = false;
                C4 = false;
            }
            else 
            {
                this.panBrand02.Visible = false;
                this.picPad.Left = (this.picPhone.Left) + (this.picPhone.Width) + 3;
                this.picWear.Left = (this.picPhone.Left) + (this.picPhone.Width) + (this.picPad.Width) + 3;
                C5 = !C5;
            }
        }

        private void btnLogout_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
